<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script>
    //实例化对象封装数据
    let p1 = {
        name:"张三",
        salary:3000,
        job:"销售"
    }
    console.log(p1.name);
    console.log(p1.salary);
    console.log(p1.job);
    //数组中装对象
    let arr = [{name:"张三", salary:3000, job:"销售"},
        {name:"李四", salary:4000, job:"人事"},
        {name:"王五", salary:5000, job:"出纳"}]
    //循环遍历
    for (let person of arr) {
        console.log(person.name+":"+person.salary+":"+person.job);
        let h = document.createElement("h1");
        h.innerText = person.name+":"+person.salary+":"+person.job;
        //通过document.body得到body元素对象
        document.body.append(h);
    }


</script>
</body>
</html>